#include "stdheader.h"

/////////////////////////////////////////////////////////

CMenuScreen::CMenuScreen() 
{
}

/////////////////////////////////////////////////////////

CMenuScreen::~CMenuScreen()
{
}

/////////////////////////////////////////////////////////

void CMenuScreen::Process(float fTimeDelta)
{
	CBaseScreen::Process(fTimeDelta);
}

/////////////////////////////////////////////////////////

void CMenuScreen::Render(sf::RenderWindow* pWin)
{
	CBaseScreen::Render(pWin);
	pWin->draw(m_tChars[CGame::Instance()->GetActiveChar()]);
	CBaseScreen::RenderFade(pWin);
}

/////////////////////////////////////////////////////////

void CMenuScreen::ProcessInput(sf::Event& tEvent)
{
	if (tEvent.type == sf::Event::KeyPressed && tEvent.key.code == sf::Keyboard::Return)
	{
		StartFadeOut();
		CGame::Instance()->RequestStateChange(EGameState_InGame);
	}
}

/////////////////////////////////////////////////////////

void CMenuScreen::LayoutScreen()
{
	CBaseScreen::LayoutScreen();

	m_tBGTex.loadFromFile("Resources/Art/Screens/LevelSelect.png");
	m_tBG.setTexture(m_tBGTex);

	m_tCharTexs[0].loadFromFile("Resources/Art/Characters/Doge.png");
	m_tCharTexs[1].loadFromFile("Resources/Art/Characters/Ox.png");
	m_tCharTexs[2].loadFromFile("Resources/Art/Characters/Rat.png");
	m_tCharTexs[3].loadFromFile("Resources/Art/Characters/Rooster.png");

	for (int i = 0; i < MAX_CHARS; i++)
	{
		m_tChars[i].setTexture(m_tCharTexs[i]);
		m_tChars[i].setPosition(200, 300);
	}	

	StartFadeIn();
}

/////////////////////////////////////////////////////////